//SRM233Div2_500;
//SRM233DIV1_250;
//2009/10/23 16:28:28
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class PipeCuts
{
public:
	double probability(vector <int> weldLocations, int L)
	{
		int count = 0;
		sort(weldLocations.begin(), weldLocations.end());
		for(int i=0; i<weldLocations.size(); i++)
		{
			for(int j=i+1; j<weldLocations.size(); j++)
				if((weldLocations[j]-weldLocations[i]>L) || weldLocations[i]>L || (100-weldLocations[j])>L)
					count ++;
		}
		return 2.0 * count / ((weldLocations.size()-1) * weldLocations.size());
	}
};
